//
//  RandomData.swift
//  DentalFormula
//
//  Created by AMalashin on 28.09.2023.
//

import Foundation

struct RandomData {
    static let conditions: [ToothCondition] = [ .intact, .decay, .filling, .decayFilling, .missed ]
    static func generate() -> [Tooth] {
        var teeth: [Tooth] = []
        for q in 1...4 {     // quadrant
            for n in 1...8 { // number inside the quadrant
                if Bool.random() {
                    teeth.append( Tooth(number: q * 10 + n, condition: conditions.randomElement())! )
                }
            }
        }
        return teeth
    }
}
